// ABC414  B.cpp
#include <bits/stdc++.h>
using namespace std;
const int N = 10000;
char c[N];
long long l[N];

int main() {
  long long tot = 0;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> c[i] >> l[i];
    tot += l[i];
    if (tot > 100) {
      cout << "Too Long";
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= l[i]; j++)
      cout << c[i];
  }

  return 0;
}
